home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F29003_InsSmObj.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-10  |  2.4 KB  |  84 lines

  1. /******************************************************************/
  2. /*                                                                */
  3. /*                      TurboCAD for Windows                      */
  4. /*                   Copyright (c) 1993 - 1999                    */
  5. /*             International Microcomputer Software, Inc.         */
  6. /*                            (IMSI)                              */
  7. /*                      All rights reserved.                      */
  8. /*                                                                */
  9. /******************************************************************/
  10.  
  11.  
  12. // Note: Proxy/Stub Information
  13. //        To build a separate proxy/stub DLL, 
  14. //        run nmake -f AALBToolps.mk in the project directory.
  15.  
  16. #include "stdafx.h"
  17. #include "resource.h"
  18. //#include "initguid.h"
  19. #include "InsSmObj.h"
  20.  
  21. #include "InsSmObj_i.c"
  22. #include "SmObj.h"
  23.  
  24. COleVariant varMissing((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
  25. COleVariant varTrue(1L);
  26. COleVariant varFalse(0L);
  27.  
  28. CComModule _Module;
  29.  
  30. BEGIN_OBJECT_MAP(ObjectMap)
  31.     OBJECT_ENTRY(CLSID_InsSmObj, CInsSmObj)
  32. END_OBJECT_MAP()
  33.  
  34. CInsSmObjApp theApp;
  35.  
  36. BOOL CInsSmObjApp::InitInstance()
  37. {
  38.     _Module.Init(ObjectMap, m_hInstance);
  39.     return CWinApp::InitInstance();
  40. }
  41.  
  42. int CInsSmObjApp::ExitInstance()
  43. {
  44.     _Module.Term();
  45.     return CWinApp::ExitInstance();
  46. }
  47.  
  48. /////////////////////////////////////////////////////////////////////////////
  49. // Used to determine whether the DLL can be unloaded by OLE
  50.  
  51. STDAPI DllCanUnloadNow(void)
  52. {
  53.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  54.     return (AfxDllCanUnloadNow()==S_OK && _Module.GetLockCount()==0) ? S_OK : S_FALSE;
  55. }
  56.  
  57. /////////////////////////////////////////////////////////////////////////////
  58. // Returns a class factory to create an object of the requested type
  59.  
  60. STDAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID* ppv)
  61. {
  62.     return _Module.GetClassObject(rclsid, riid, ppv);
  63. }
  64.  
  65. /////////////////////////////////////////////////////////////////////////////
  66. // DllRegisterServer - Adds entries to the system registry
  67.  
  68. STDAPI DllRegisterServer(void)
  69. {
  70.     // registers object, typelib and all interfaces in typelib
  71.     return _Module.RegisterServer(TRUE);
  72. }
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75. // DllUnregisterServer - Removes entries from the system registry
  76.  
  77. STDAPI DllUnregisterServer(void)
  78. {
  79.     _Module.UnregisterServer();
  80.     return S_OK;
  81. }
  82.  
  83.  
  84.